import httpUtils from '@/api/http'
import { Message } from 'element-ui';

// 查询院校和专业
export const schoolDictQuery = (query,goLogin) => {
	return httpUtils.get('/sys/dictItem/listByText', query,goLogin)
}

export const majorDictQuery = (query,goLogin) => {
	return httpUtils.get('/sys/dictItem/listByText', query,goLogin)
}
//获取短信验证码token
export const getSmsCodeToken = (params,goLogin) => {
	return httpUtils.post('/person/sms/create_token.thtml',params,goLogin);
}
// 获取图片验证码
export const getRandomImage = (query,goLogin) => {
	return httpUtils.get('/sys/randomImage/' + query.time, query,goLogin)
}

//获取短信验证码
export const getSmsCode = (params,goLogin) => {
	return httpUtils.post('/person/sms/send',params,goLogin);
}

//验证码登录
export const login = (params,goLogin) => {
	return httpUtils.post('/person/code/login',params,goLogin);
}

// 修改密码
export const updatePassword = (query,goLogin) => {
	return httpUtils.post('/sys/user/updatePassword', query,goLogin)
  }

//退出登录
export const signOut = (params,goLogin) => {
	return httpUtils.post('/person/code/logout',params,goLogin);
}

//个人信息查询
export const personInfo = (params,goLogin) => {
	return httpUtils.get('/personal/v1/piInfo/queryById',params,goLogin);
}

//个人信息各个数量
export const personInfoEnterNum = (params, goLogin) => {
	return httpUtils.get('/personal/v1/piInfo/getInfoNum', params, goLogin);
}

//个人信息编辑
export const personInfoEdit = (params, goLogin) => {
	if(params.name.indexOf("游客") === 0) {
		Message.error('姓名不能为游客，请编辑真实姓名！')
		return false;
	}
	return httpUtils.post('/personal/v1/piInfo/edit', params, goLogin);
}

//个人信息头像保存
export const updatePhoto = (params, goLogin) => {
	return httpUtils.post('/personal/v1/piInfo/updatePhoto', params, goLogin);
}

//查询简历
export const getResume = (params, goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/getResumeInfoByUserId', params, goLogin);
}

//检查简历完成情况
export const resumeCheck = (params, goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/check', params, goLogin);
}


//简历本历查询
export const resumeList = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/list',params,goLogin);
}

//调取附件简历
export const getResumeBriny = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/getResumeBriny',params,goLogin);
}

//获取文件下载签名
export const getSign= (params,goLogin) => {
	return httpUtils.post('/sys/common/sign',params,goLogin);
}

//简历本历添加
export const resumeAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvResume/add',params,goLogin);
}

//根据简历id更新在线简历详情（中文）
export const updateResumeInfo = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/updateResumeInfo',params,goLogin);
}
//根据简历id更新在线简历详情（英文）
export const updateResumeInfoEn = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/updateResumeInfoEn',params,goLogin);
}

//简历本历删除
export const resumeDelete = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/delete',params,goLogin);
}

//教育经历编辑
export const eduInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvUserEduInfo/edit',params,goLogin);
}

//教育经历添加
export const eduInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvUserEduInfo/add',params,goLogin);
}

//教育经历删除
export const eduInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvUserEduInfo/delete',params,goLogin);
}

//工作经验编辑
export const workInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvUserWorkInfo/edit',params,goLogin);
}

//工作经验添加
export const workInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvUserWorkInfo/add',params,goLogin);
}

//工作经验删除
export const workInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvUserWorkInfo/delete',params,goLogin);
}

//求职意向 期望职位编辑
export const workIntentionEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvWorkIntention/edit',params,goLogin);
}

//家庭成员删除
export const cvFamilyMemberDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvFamilyMember/delete',params,goLogin);
}
//家庭成员添加
export const cvFamilyMemberAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvFamilyMember/add',params,goLogin);
}

//家庭成员编辑
export const cvFamilyMemberEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvFamilyMember/edit',params,goLogin);
}

//期望职位添加
export const workIntentionAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvWorkIntention/add',params,goLogin);
}

//期望职位删除
export const workIntentionDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvWorkIntention/delete',params,goLogin);
}

//简历本历编辑
export const resumeEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvResume/edit',params,goLogin);
}

//项目经历添加
export const projectInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvProjectInfo/add',params,goLogin);
}

//项目经历编辑
export const projectInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvProjectInfo/edit',params,goLogin);
}

//项目经历删除
export const projectInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvProjectInfo/delete',params,goLogin);
}

//培训经历添加
export const trainInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvTrain/add',params,goLogin);
}

//培训经历编辑
export const trainInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvTrain/edit',params,goLogin);
}

//培训经历删除
export const trainInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvTrain/delete',params,goLogin);
}

//语言能力添加
export const languageInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvLanguageLevel/personal/add',params,goLogin);
}

//语言能力编辑
export const languageInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvLanguageLevel/personal/edit',params,goLogin);
}

//语言能力删除
export const languageInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvLanguageLevel/personal/delete',params,goLogin);
}

//特长技能添加
export const skillInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvSkills/add',params,goLogin);
}

//特长技能编辑
export const skillInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvSkills/edit',params,goLogin);
}

//特长技能删除
export const skillInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvSkills/delete',params,goLogin);
}

//资质证书添加
export const certificateInfoAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvCertificate/add',params,goLogin);
}

//资质证书编辑
export const certificateInfoEdit = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvCertificate/edit',params,goLogin);
}

//资质证书删除
export const certificateInfoDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvCertificate/delete',params,goLogin);
}

//简历附件删除
export const resumeFileDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/cvResume/file/delete',params,goLogin);
}

//职位详情
export const jobDetails = (params,goLogin) => {
	return httpUtils.get('/personal/opJob/queryById',params,goLogin);
}

//看过的职位
export const browseHistory = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opBrowseHistory/list',params,goLogin);
}

//收藏职位
export const collectionAdd = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opCollection/add',params,goLogin);
}

//收藏职位状态
export const collectState = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opCollection/collectState',params,goLogin);
}

//收藏职位状态
export const collectStateList = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opCollection/collectStateList',params,goLogin);
}

//收藏职位状态
export const collectionDelete = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opCollection/delete',params,goLogin);
}

//投递简历
export const postResume = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opDeliveryHistory/add',params,goLogin);
}

//公司主页
export const companyIndex = (params,goLogin) => {
	return httpUtils.get('/personal/enInfo/queryById',params,goLogin);
}

//专场列表
export const specialList = (params,goLogin) => {
	return httpUtils.get('/personal/ssSession/list',params,goLogin);
}

//专场列表（原始版）
export const specialList2 = (params,goLogin) => {
	return httpUtils.get('/personal/ssSession2/list',params,goLogin);
}

//专场详情
export const specialDetail = (params,goLogin) => {
	return httpUtils.get('/personal/ssSession/queryById',params,goLogin);
}

export const getParticipationDetail = (params,goLogin) => {
	return httpUtils.get('/personal/ssSession/queryDetailNumById',params,goLogin);
}

//专场详情职位
export const specialDetailJob = (params,goLogin) => {
	return httpUtils.get('/personal/ssSession/getJobList',params,goLogin);
}

//数据查询(数据分类 industry 行业, position 职位职类, province 省/直辖市, city 市, district 区 )
export const baseData = (params,goLogin) => {
	return httpUtils.get('/base/data',params,goLogin);
}

//数据搜索 (数据分类 position 职位, university 学校, speciality 专业  )
export const baseSearch = (params,goLogin) => {
	return httpUtils.get('/base/so',params,goLogin);
}

//区块查询 (数据分类 position 职位, university 学校, speciality 专业  )
export const block = (params,goLogin) => {
	return httpUtils.get('/base/block',params,goLogin);
}

//上传文件
export const uploadFile = (params,goLogin) => {
	return httpUtils.post('/sys/common/upload',params,goLogin);
}

//栏目接口
export const cmsChannel_list = (params,goLogin) => {
	return httpUtils.get('/personal/cmsChannel/list',params,goLogin);
}

//内容列表接口
export const cmsContent_list = (params,goLogin) => {
	return httpUtils.get('/personal/cmsContent/list',params,goLogin);
}

//内容详情
export const cmsContent_queryById = (params,goLogin) => {
	return httpUtils.get('/personal/cmsContent/queryById',params,goLogin);
}

//企业列表接口
export const eninfo_list = (params,goLogin) => {
	return httpUtils.get('/personal/eninfo/list',params,goLogin);
}

//我的消息列表
export const messageList = (params,goLogin) => {
	return httpUtils.get('/personal/v1/enNews/list',params,goLogin);
}

//我的消息未读数量
export const messageCount = (params,goLogin) => {
	return httpUtils.post('/personal/v1/enNews/count',params,goLogin);
}

//修改手机号
export const changePhone = (params,goLogin) => {
	return httpUtils.post('/personal/v1/piInfo/modify_phone',params,goLogin);
}

//个人中心-我期望的职位
export const workIntention = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvWorkIntention/list',params,goLogin);
}

//个人中心-投递记录
export const postRecord = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opDeliveryHistory/list',params,goLogin);
}

//个人中心-面试邀请
export const interviewRecord = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opInterviewHistory/list',params,goLogin);
}

//个人中心-面试邀请详情
export const interviewDetails = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opInterviewHistory/queryById',params,goLogin);
}

//个人中心-入职邀请
export const entryRecord = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opEntryHistory/list',params,goLogin);
}

//个人中心-入职邀请详情
export const entryDetails = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opEntryHistory/queryById',params,goLogin);
}

//个人中心-我的收藏
export const myCollectRecord = (params,goLogin) => {
	return httpUtils.get('/personal/v1/opCollection/list',params,goLogin);
}

//个人中心-接受或拒绝面试
export const acceptInview = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opInterviewHistory/acceptInview',params,goLogin);
}

//个人中心-接受或拒绝入职
export const acceptEntry = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opEntryHistory/acceptEntry',params,goLogin);
}

//个人中心-消息详情
export const newsDetails = (params,goLogin) => {
	return httpUtils.get('/personal/v1/enNews/queryById',params,goLogin);
}

//个人中心-系统消息
export const announcement = (params,goLogin) => {
	return httpUtils.get('/personal/v1/leavingNews/list',params,goLogin);
}

//个人中心-留言
export const formMessage = (params,goLogin) => {
	return httpUtils.post('/personal/v1/leavingNews/add',params,goLogin);
}

//屏蔽企业
export const screen = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opShielding/add',params,goLogin);
}

//取消屏蔽企业
export const screenC = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opShielding/unAdd',params,goLogin);
}
//获取微信token
export const wxLogin_setToken = (params,goLogin) => {
	return httpUtils.post('/personal/wxLogin/pc/setToken',params,goLogin);
}
//check
export const wxLogin_check = (params,goLogin) => {
	return httpUtils.get('/personal/wxLogin/pc/check',params,goLogin);
}
//获取微信token
export const wxBind_setToken = (params,goLogin) => {
	return httpUtils.post('/personal/wxBind/pc/setToken',params,goLogin);
}
//check
export const wxBind_check = (params,goLogin) => {
	return httpUtils.get('/personal/wxBind/pc/check',params,goLogin);
}
//查询绑定情况
export const queryBindState = (params,goLogin) => {
	return httpUtils.get('/person/code/v1/user/third/queryBindState',params,goLogin);
}
//解绑
export const unbind = (params,goLogin) => {
	return httpUtils.post('/person/code/v1/user/third/unbind',params,goLogin);
}
//解绑
export const dropResumeInfo = (params,goLogin) => {
	return httpUtils.post('/personal/v1/opDeliveryHistory/dropInfoById',params,goLogin);
}

//x下载简历
export const downloadResume = (params,goLogin) => {
	return httpUtils.get('/personal/v1/cvResume/download',params,goLogin,true);
}


